package org.example.campus_sys_backend.mapper;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.campus_sys_backend.model.UserInfo;

@Mapper
public interface UserInfoMapper {

    @Select("select id, login_name, password, gender, birthday,phone ,email ,status, name, description " +
            "from user where  login_name =#{loginName}")
       UserInfo queryUserByName(String loginName);
    @Select("select id, login_name, password, gender, birthday,phone ,email ,status, name, description " +
            "from user where  id =#{id}")
       UserInfo queryUserById(Integer id);
    @Insert("insert into user (login_name, password, gender, birthday,phone ,email, name, description)  " +
            "values (#{loginName}, #{password}, #{gender}, #{birthday}, #{phone}, #{email},#{name}, #{description})")
       Integer insertUser(UserInfo userInfo);
}
